/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn;

/**
 * <p>Project: javase202202 - T5
 * <p>Powered by Lisi On 2022-06-07 14:29:52
 * <p>Created by IntelliJ IDEA
 *

 * @version 1.0
 * @since 17
 */
public class T5 {
    static int i = 0;

    public void mm(int n) {
        ++i;
        System.out.print(i + " ");
        if(i<n) {
            mm(n);
        }
    }

    private T5(){

    }

    int jiec(int n){
        if(n==1){
            return n;
        }else{
            return n*jiec(--n);
        }
    }

    public static void main(String[] args) {
       var t = new T5();
       //t.m(16);
        //t.m(1,5);
        //t.mm(5);
        //System.out.println(t.jiec(3));
        for (int i1 = 1; i1 <= 10; i1++) {
            System.out.printf("%d阶乘=%d%n",i1,t.jiec(i1));
        }
    }

    public void m(int n) {
        if(n>=1) {
            System.out.println(n--);
            //return; //代表在某种条件下结束过程执行 相当于循环语句的 break;
            m(n);
        }
    }

    public void m(int n,int m) {
        if(n<=m) {
            System.out.println(n);
            //return; //代表在某种条件下结束过程执行 相当于循环语句的 break;
            m(++n,m);
        }
    }
}
